Repository navigation
fix(metadata-protocol)!: the diff door refuses a bare two-holder name and compares one holder by ?package= - #34147
Conversation
…a by-package name Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
…es its request and takes ?package= Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
📓 Docs Drift CheckThis PR changes 3 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 12 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 925696b487bc88fa64c907434d02591c1c5a60a1 && git checkout 925696b487bc88fa64c907434d02591c1c5a60a1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b8456ebd4abb498233a13bdd65955d14e7e46825 624b7ff3930c868fa9e904cbdb818182361edcc4 && git checkout -B drift-repro b8456ebd4abb498233a13bdd65955d14e7e46825 && git merge --no-ff 624b7ff3930c868fa9e904cbdb818182361edcc4
node scripts/docs-audit/affected-docs.mjs --json b8456ebd4abb498233a13bdd65955d14e7e46825
|
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 37fd605 · 2026-11-15T23:02Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-15T23:10Z. First review of this head, taken on patrol as owed; claim: comment 6902844568. Independence: implemented in a zhuangjianguo lane (domain:server#5); neither dispatched nor implemented by os-tesla. ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix.
S1 (should-fix) — The published SDK cannot follow the remedy, and the PR body names a carrier that is closed. S2 (should-fix) — Three claims of the changeset have no pin at this door. (a) N1 (nit) — The changeset says a package that neither holds nor ships the name is refused Implemented-by: VERDICT: PASS |
…environment's slot through a package, and the holders' wire order The changeset now says the SDK's meta.diffItem sends no package, so an SDK caller's remedy is a raw request, and states the condition of the not-held-by-qualifier refusal. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 8ed0741 · 2026-11-16T01:02Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T01:09Z. Delta review of this head against PASS 6902957227 at 37fd605; claim: comment 6904443361; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for domain:server#5; reviewed by os-tesla, who neither dispatched nor implemented it. ① Derived judgments
Prior findings, by id:
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix.
S1 (should-fix; continues S1 of 6902957227) — The PR body's Acceptance note still says the client half belongs on #33310 or beside it. #33310 was closed as not planned on 2026-11-15 (record 6897313072) and lists S2 (should-fix; new, from the merge of #34036) — On a Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ Request: review · PR #34147 · area S4 (E1) · Fixes #33308 · head 8ed0741 (green: 58 success, 10 expected skip, none failed; declared final) Ordinary ACCEPT read (L1) per review-checklist.md. L2 is in: review#2 PASS 6902957227 at 37fd605 and delta PASS 6904546735 at this head.
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jTyY9BGjj9WBi7QgH6 Review — PASSHead-sha:
The patch-id is |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ 席位核对ACCEPT · area S4 (E1) · Head-sha:
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ Landing (landing-operations B) · head
State change: ready + auto-merge (area authorising line). |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43785715442 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43788204637 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 624b7ff · 2026-11-16T04:01Z |
|
review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW Contract reviewServed-tier: Read at 2026-11-16T04:09Z. Delta review of this head against PASS 6904546735 at 8ed0741; claim: comment 6906907759; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for domain:server#5; reviewed by os-tesla, who neither dispatched nor implemented it. ① Derived judgments
Prior findings, by id:
② Semver level
CI completed before posting: 68 check-runs on this head, 58 success, 10 skipped, none failed. ③ Boundary flags
④ Design judgmentNo must-fix.
S1 (should-fix; continues S2 of 6904546735, reduced) — For a Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ 席位核对 (delta)ACCEPT · area S4 (E1) · Head-sha:
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ Re-landing (landing-operations B) · head
State change: auto-merge re-armed (area authorising line). |
Requested by Steedos · project thread
Fixes #33308
Clause-②: yes (narrowing)
Metadata-protocol: added
Skills-docs: none — no skill under
skills/names the diff door, and the docs that do (content/docs/api/client-sdk.mdx,content/docs/permissions/system-context.mdx,content/docs/ui/apps.mdx) name the route without teaching how a name two packages hold is addressed, so no sentence there turns false; the generated API reference (content/docs/references/api/protocol.mdx) carries the newDiffMetaItemRequestwith itspackageId.Declaration note: the claim (6895872289) first read
Clause-②: no (narrowing), amended on the card (6898947511). BesideMetadata-protocol: addedthat pair is acontradictionincheck-changeset-no-major.mjs(added-under-no, exit 1), and this PR widens a published request (the newDiffMetaItemRequestSchema, and the door now takes?package=), so the lines above are #33193's (yes (narrowing)+added), the precedent this card mirrors. Measured both ways under Verification.维护者速读
?package=只比较那一家的版本(默认的“当前版本”也取那一家的行)。非按包存储的类型带?package=返回 400。spec 新增DiffMetaItemRequestSchema声明这个接口的请求。GET /meta/flow/NAME/diff返回 200,把 beta 的 v2 和 alpha 的 v3 比成“同一条记录的修改”,管理员据此判断回滚会恢复什么,会选错。packages/metadata-protocol/src/protocol-diff-delete-load.ts(diffMetaItem接入historySlotOf,默认 to/from 取本槽)、packages/rest/src/meta-item-history-routes.ts(diff 门接?package=)、packages/qa/dogfood/test/history-diff-two-holders-33308.dogfood.test.ts。pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=1 test/history-diff-two-holders-33308.dogfood.test.ts,9 条全绿。What changes
The rule is #33193's, not a second one.
diffMetaItem(protocol-diff-delete-load.ts) askshistorySlotOf(protocol-history-slots.ts, unchanged) which row slot it addresses, exactly ashistoryMetaItemandrollbackMetaItemdo:resolveItem, ADR-0150 D5), is refused409 RESOURCE_CONFLICTnaming every holder (details.candidates) before any version is read: the default range and a named one alike. A name one slot holds diffs bare exactly as onmain.?package=Pcompares P's slot only: the history rows are filtered by the same predicate the history door reads (isVersionOf, now exported fromsys-metadata-repository.ts), so the defaultfromside is P's nearest earlier differing version and the defaulttoside is P's own active row (bound to P, or the package-less row for the environment's slot), never the name's first active row. A named version another holder owns, or one attributed to no package while two hold the name, is refused404 VERSION_NOT_FOUNDsaying whose it is (versionOfAnotherSlotError, one sentence shared with the rollback door: "Nothing was compared." / "Nothing was restored.").?package=is refused400 VALIDATION_ERROR(param: package) by the protocol (refusePackageSelectorOutsideSlottedTypes), never accepted and dropped.Door (
GET /meta/:type/:name/diff):packagejoinsMETA_ITEM_DIFF_PARAMSand the door's repeat guard, is read throughhistoryPackageSelector/metaItemPackageBindingas the history door reads it (alland empty name no package), and the refusal rendersdetails.candidates(packageScopedCandidates). The request is compiled against the new declaration (TransportScopedMetaRequestofDiffMetaItemRequest), and both bounds are read throughDiffMetaItemRequestSchema.shape.fromVersion/toVersion(z.number().int(), the same whole numberUNDECLARED_WHOLE_NUMBER_PARAMread: no bound is refused that was accepted before).Spec:
DiffMetaItemRequestSchema(type,name,fromVersion,toVersion,packageIdwith the history doors'HISTORY_PACKAGE_SELECTOR_DESCRIPTION), itsDiffMetaItemRequest/DiffMetaItemRequestParsedtypes, and the regeneratedapi-surface,authorable-surface,declaration-map,export-origins,json-schema.manifest, reference docs and strictness-ledger count.protocol.ts: only thediffMetaItemrequest type (packageId?: string) and its docblock (@throwsfor the 409, the cross-slot 404 and the 400), edited after #33898 merged.Console: no
ui/file changes.@object-ui/data-objectstack'sMetadataClient.diff()calls the door but nothing inui/callsdiff()(theengine.layers.difftab is the Layers view, not this door), so there is no diff view to name the package in. See Acceptance notes.Tests
packages/qa/dogfood/test/history-diff-two-holders-33308.dogfood.test.ts(new, 9 cases, its own showcase boot with twoAppPluginholders and their.custompairs): bare two-holder 409 with candidates (default range and named), their order andkindpinned at the wire; a package that neither holds nor ships the name 409 naming the holders; the environment's slot addressed through a package (the package-less row's versions alone, its own active row thetoside, beside a bound row listed first); a name two packages ship one customized 409 as the bare read,?package=default range and named range inside the slot, another holder's version and an unattributed one 404, CONTROL one-holder bare (and?package=of its holder answers the same), CONTROL M1 environment versions,?package=onview400 with the protocol's reason.packages/metadata-protocol/src/protocol-diff-history-slots.33308.test.ts(new, 10 cases): the facet against a fake host, each arm alone; the bare refusal and thenot-held-by-qualifierrefusal read no table; the environment's slot addressed through a package takes the package-less row as itstoside when a bound row is listed first.packages/rest/src/meta-item-history-package-selector.test.ts: a new top-leveldescribefor the diff door in the family's existing harness (AGENTS.md, ruling record 6583487846): PRESERVATION under both bound spellings, CONTROLall/empty, REFUSAL repeated?package=, 409 candidates, 400 through the real protocol.rest-server-meta-door-closed-sets.test.ts: the measured-set pin takespackage.packages/spec/src/api/protocol.test.ts: a new top-leveldescribeforDiffMetaItemRequestSchemabeside the rollback request's.Before the fix (H1 measured on this boot, pre-fix runtime): 6 of 7 red
The bare default range alone answered alpha's v3 against beta's v2: the cross-holder diff the card measured, without even naming a version.
Ablations (each leg: `scripts/ablation-replace.mjs` anchor x1 → x0 and blob change proved, package rebuilt, `ablation-dist-preflight.mjs` exit 0 on the marker, dogfood file run, restore to HEAD proved by blob and empty `git diff HEAD`, rebuilt, preflight `--absent` exit 0)
diffMetaItemskipshistorySlotOfwhen no package is named (__ablate33308_A1)the bare diff of the two-holder name is refused 409…:{"fromVersion":2,"toVersion":3,…"from":"…beta.custom r1","to":"…alpha.custom r2"} expected 200 to be 409;a name two packages ship, one customized…:expected 200 to be 409isVersionOffilter bypassed,__ablate33308_A2)?package= diffs that holder's versions alone…:expected [ 2, 3 ] to deeply equal [ 1, 3 ];?package= refuses another holder's version…:{"fromVersion":2,"toVersion":1,…} expected 200 to be 404?package=and drops it (__ablate33308_A3, rest)?package=casesexpected 409 to be 200/expected 409 to be 404;?package= on a type not stored per package…:{"type":"view",…"fromVersion":null,"toVersion":null,…} expected 200 to be 400__ablate33308_A4)a package that neither holds nor ships the name is refused 409…:{"type":"flow",…"fromVersion":null,"toVersion":null,…} expected 200 to be 409; facet 1 of 10:expected null to be an instance of PackageScopedNameRefusedError__ablate33308_A5)expected [ null, null ] to deeply equal [ 1, 2 ]. The first try of this leg was refused byablation-replace.mjsas a no-op (the replacement contained the anchor,anchor count moved 1 -> 1), so it was rerun with an anchor-free replacement__ablate33308_A6,protocol-history-slots.ts)expected [ { kind: 'environment' }, …(1) ] to deeply equal [ { kind: 'package', …(1) }, …(1) ]; facet 3 of 10After the last leg of each round: preflight
--absentexit 0, tree clean. At8ed07410cdafter A4 to A6: the dogfood file 9/9, the facet file andprotocol-history-slotstests 25/25.Acceptance notes
MetadataClient.diff()(ui/packages/data-objectstack/src/metadata-client.ts) takes nopackageId; noui/code calls it today, so nothing user-facing turns wrong, but a consumer of@object-ui/data-objectstackcalling it on a two-holder name now gets the409with no way to name the holder. The SDK'sclient.meta.diffItem(packages/client/src/index.ts) sends onlyfromandtoas well, so an SDK caller's FROM / TO remedy is a raw request (the changeset says so). The client half of both is decided not planned: client: meta.getHistory, rollbackItem and diffItem cannot name a package, so a two-holder item's history is unreachable through the SDK (ADR-0150 D3, after #32905) #33310, which namesmeta.diffItem, was closed as not planned on 2026-11-15 (record 6897313072) and reopens on need. It is not a pending follow-up of this PR.docname two packages hold, at this door: the changeset's400onpackagefor a type not stored per package does not describe adocname two enabled packages hold. That request is refused409with or without?package=, as the doc reads are today. The remedy is metadata-protocol: the layered read of a doc name two enabled packages hold answers one holder's layers while the plain read refuses (ADR-0150 D3/D5) #34190 (open), not this PR.packages/metadata-protocol/src/sys-metadata-repository.ts(not on the claim's File surface):isVersionOfis exported (the order names that predicate as the one to reuse; it was module-private), and the rollback's cross-slot404sentence moved intoversionOfAnotherSlotErrorso both doors say it once. The rollback's message is unchanged (the same sentence, with "Nothing was restored." passed as the outcome).showcase-boot.ts, shared by every file; the facet pin has its own fake host); the REST and spec pins are top-leveldescribes in the family's existing harness files, per AGENTS.md (ruling record 6583487846).meta-item-history-routes.ts5865708652 (letter B), 5856774816, 6787890900;protocol-diff-delete-load.ts[finding] diffMetaItem answers 200 with an empty diff when sys_metadata_history is unreadable — an outage is indistinguishable from "nothing changed" #8833 maintainer ruling (nohistoryUnavailablekey), commit 75e66fc Option B (diff raw, redact emitted), [finding]GET /meta/:type/:name/diffserves PENDING draft content to a member with no authoring capability: its history versions include draft saves, and it is the one draft-serving door the #20338 gate leaves open #20378 /GET /meta/:type/:name/diffwith nofrom: after a draft is published, the default range compares the new version against the draft's own save and answers "no changes", never against the previous published version #20451 retriage answers (the from-side walk by this diff's own equality, now inside the slot). No ruling,maintaineror⛔line is edited or removed; one⛔comment added (never another holder's version compared).Verification
Regenerated head
624b7ff393(after a merge-queue red onscripts/root-index.test.ts, a stated count stale against main):origin/main98a4449f87merged throughscripts/pm/os-regen-merge.shand the reference pages regenerated. The own non-generated patch-id ise97b7a9cd143before and after; onlycontent/docs/references/index.mdxmoves, now 1664 schemas.scripts/root-index.test.ts20/20,check:generatedup to date, the dogfood pin 9/9, CI 58 success / 10 skipped. Contract delta PASS 6907048910. The readings below are from8ed07410cd.Head
8ed07410cd. It is the review's two should-fix items on top of71cb83eb36, a merge oforigin/mainatb4eea88505. That main contains #34104 (e9fb09871d), the fix for therun-date.test.tstimeouts behind theTest Core (7/8)red at37fd6054d0. Every reading below ran underscripts/pm/os-verify-lock.shand is quoted from itsVERDICTline. Every suite and gate is green.The merge brought only main's changes. This branch's diff against its base has the same
git patch-id(964c6bf182) before and after the merge. So the full dogfood battery at37fd6054d0still stands: 468 passed and 3 skipped of 471 files, 3966 tests passed. The new commit adds test pins and changeset prose only.Readings: suites, typecheck, pins, gates, body gates, merge-tree
turbo run build, dogfood and scenarios closures):VERDICT command-exit 0.@objectstack/scenariostest/runner/run-date.test.ts: 35/35,VERDICT command-exit 0.@objectstack/metadata-protocol: Test Files 343 passed, 9 skipped; Tests 22934 passed, 45 skipped.VERDICT command-exit 0.@objectstack/rest: Test Files 418/418; Tests 8762 passed, 355 skipped.VERDICT command-exit 0.@objectstack/spec: Test Files 934/934; Tests 28526 passed, 1 todo.VERDICT command-exit 0.check:generated: "All 14 generated artifacts are up to date".8ed07410cd, after the A4 to A6 legs: the dogfood file 9/9; the facet file andprotocol-history-slotstests 25/25.dispatch-gates --commands --repo objectstack-ai/objectstack, 122 families at8ed07410cd): 122 exit 0, includingcheck:skill-examplesandcheck:dual-build-cjs-loads, NOT MEASURED at the previous head.--ran: "122 derived, 122 run, 0 NOT-MEASURED, 0 UNRUN".check-changeset-no-majorexit 0.check-adr-0087-registrationexit 0.check-partof-closing-keywordexit 0.check-closing-keyword-parity --bodyreports the one closing declaration on this body, bound by 2 of 3 parsers (informational).check:nul-bytesexit 0.--write-tree --name-only): no conflicted path againstorigin/mainb4eea88505(exit 0), nor against fix(metadata-protocol, rest)!: the layered read of a name two packages hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) #33885 heade57e7c0566(exit 0).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ